<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="com.yaodian100.ec.coupon.entity.CouponItem"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="com.yaodian100.core.common.utils.DateUtil"%>
<%@page import="org.apache.commons.lang.time.DateUtils"%>
<%@page import="java.util.Date"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<link rel="stylesheet" href="/css/jtips.css" type="text/css" id="" media="print, projection, screen" />
<script src="/js/jtip.js"></script>
<script src="/js/jquery.form.js"></script>
<script language="javascript">
$().ready(function(){
	
	$("#current_location").html('&nbsp;&gt;&nbsp;我的礼券&nbsp;-&nbsp;礼券充值');
	$("#wait_li").removeAttr('class');
	$("#use_li").removeAttr('class');
	$("#acc_li").removeAttr('class');
	$("#get_li").attr('class','mb-tab-f');
	$("#submit_data").click(function(){
		var targetForm = $("#mainForm");
		var now = new Date();
		var millisecondsOfNow = now.getTime();
		$("#timeStamp").val(millisecondsOfNow);
		targetForm.ajaxForm({
			url:'<s:url value="/member/myCoupon/gettingCoupon.do"></s:url>' + '?timeStamp=' + millisecondsOfNow
			,target:$("#tab")
		});
		targetForm.submit();
	});
});
</script>
</head>
<body>
	<s:if test="couponItemCodeError">
		<DIV id="codeErrorAlert" title="优惠码错误" class="member-reg-alert" style="display:none" >
		  <p>您的礼券促销优惠码错误！<br/><br/></p>
		  <div id="ee" align="center"> <span style="text-align:center;"><a href="#" class="btn-mid" onClick="$(this).parents('div:eq(1)').dialog('close');" >关闭</a></span> </div>
		</DIV>
		<script language="javascript">
			$().ready(function(){
				$("#codeErrorAlert").hide();
				$("#codeErrorAlert").dialog({
					bgiframe: true,
					height: 155,
					width:300,
					modal: true
				});
			});
		</script>
	</s:if>
	<s:if test="couponItemRegistered">
		<DIV id="codeRegisteredAlert" title="优惠码已充值" class="member-reg-alert" style="display:none" >
		  <p>您的促销优惠码已充值过了！<br/><br/></p>
		  <div align="center"> <span style="text-align:center;"><a href="#" class="btn-mid" onClick="$(this).parents('div:eq(1)').dialog('close');">关闭</a></span> </div>
		</DIV> 
		<script language="javascript">
			$().ready(function(){
				$("#codeRegisteredAlert").hide();
				$("#codeRegisteredAlert").dialog({
					bgiframe: true,
					height: 155,
					width:300,
					modal: true
				});
			});
		</script>
	</s:if>
	<s:if test="couponExpired">
		<DIV id="codeExpiredAlert" title="优惠码已过期" class="member-reg-alert" style="display:none" >
		  <p>您的礼券促销优惠码已经过期！<br/><br/></p>
		  <div align="center"> <span style="text-align:center;"><a href="#" class="btn-mid" onClick="$(this).parents('div:eq(1)').dialog('close');">关闭</a></span> </div> 
		</DIV> 
		<script language="javascript">
			$().ready(function(){
				$("#codeExpiredAlert").hide();
				$("#codeExpiredAlert").dialog({
					bgiframe: true,
					height: 155,
					width:300,
					modal: true
				});
			});
		</script>
	</s:if>
	<s:if test="noMoreCouponItemAllowedForCurrentCoupon">
		<DIV id="codeExpiredAlert" title="单一帐号限用一次" class="member-reg-alert" style="display:none" >
		  <p>本活动单一帐号限激活一张礼券，<br/>您已经参加过本活动！<br/><br/></p>
		  <div align="center"> <span style="text-align:center;"><a href="#" class="btn-mid" onClick="$(this).parents('div:eq(1)').dialog('close');">关闭</a></span> </div> 
		</DIV> 
		<script language="javascript">
			$().ready(function(){
				$("#codeExpiredAlert").hide();
				$("#codeExpiredAlert").dialog({
					bgiframe: true,
					height: 180,
					width:320,
					modal: true
				});
			});
		</script>
	</s:if>
	<form id="mainForm">
		<table id="cTable" border="0" class="mc-store">
			<tbody>
				<tr>
					<td><s:textfield name="couponItemCode" cssClass="coupon_store" maxLength="10" ></s:textfield></td>
					<td><a href="#" id="submit_data" on class="btn-mid-2" >充值</a></td>
				</tr>
				<tr>
					<td>请输入促销优惠码进行礼券充值。</td>
					<td></td>
				</tr>
			</tbody>
		</table>
		<s:hidden id="timeStamp"></s:hidden>
	</form>
	    
	<!-- 注意事项 -->
	<div class="txt-note">
		<ul>
			<li>．礼券使用明细仅保留 6 个月内的资料。</li>
			<li> ‧使用方式：结帐时系统会显示可使用的礼券清单，请您直接选择要使用的礼券即可。</li>
			<li> ‧礼券一经使用，不予退还。</li>
		</ul>
	</div>
	<!-- 注意事项 -->
</body>
</html>